using System;
using System.Collections.Generic;
using System.Text;

namespace ESecretary.MyCommon
{
    public class StrUtil
    {
        public static string EncriptDES(string strSrc)
        {
            return Encryption.EncriptDES(Constants.DES_KEY, strSrc);
        }
        public static string DecriptDES(string strSrc)
        {
            return Encryption.DecriptDES(Constants.DES_KEY, strSrc);
        }
        public static string TransFileSize(long fileSize)
        {
            double dtmp = (double)fileSize / (double)1024;
            string strFileSize = dtmp + "K";
            if (dtmp / (double)1024 > 0)
            {
                dtmp = dtmp / (double)1024;
                strFileSize = dtmp + "M";
            }
            if (dtmp / (double)1024 > 0)
            {
                dtmp = dtmp / (double)1024;
                strFileSize = Math.Round(dtmp, 2) + "G";
            }
            return strFileSize;
        }
    }
}
